//
//  AsyncSocket+RACSignal.h
//  高仿暴走斗图
//
//  Created by key on 16/4/1.
//  Copyright © 2016年 huangsongyao. All rights reserved.
//

#import "AsyncSocket.h"

// 公开key的宏值
#define kSOCKET         @"socket"
#define kERROR          @"error"
#define kHSOT           @"host"
#define kDATA           @"data"
#define kTAG            @"tag"

@interface AsyncSocket (RACSignal)

@property (nonatomic, strong, readonly) RACDelegateProxy *rac_delegateProxy;

/**
 *  socket将要断开
 *
 *  @return 将要断开的信号
 */
- (RACSignal *)rac_willDisconnect;

/**
 *  socket链接成功
 *
 *  @return 链接成功信号
 */
- (RACSignal *)rac_didConnectToHost;

/**
 *  socket断开后
 *
 *  @return 断开后的信号
 */
- (RACSignal *)rac_onSocketDidDisconnect;

/**
 *  socket读取数据成功后
 *
 *  @return 读取的数据信号
 */
- (RACSignal *)rac_didReadData;

/**
 *  socket写入数据后
 *
 *  @return 写入数据后的信号
 */
- (RACSignal *)rac_didWriteDataWithTag;


@end
